package com.dgut.entity;

import com.baomidou.mybatisplus.annotation.*;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.time.LocalDate;

@Builder
@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "salesorders")
public class SaleOrders implements Serializable {
    //订单支付状态常量
    public static final Integer UNPAY = 0;
    public static final Integer PAYED = 1;
    public static final Integer PARTIAL_PAYED = 2;
    //订单发货状态常量
    public static final Integer UNSEND = 0;
    public static final Integer ALLSENDED = 1;
    public static final Integer REACHED = 2;
    public static final Integer PARTAL_SENDED = 3;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @TableId(value = "order_id", type = IdType.AUTO)
    private Long orderId;//订单编号

    private Long contractId;//销售合同编号

    private Long productId;//产品编号

    private Integer quantity;//数量

    private Double price;//单价

    private String productImg;//产品图片

    /**
     * 0：未支付，1：已支付，2：部分发货
     */
    private Integer payStatus;//支付状态

    /**
     * 0：未发货，1：已发货 2. 已到货，3.部分发货
     */
    private Integer sendStatus;//发货状态

    private LocalDate orderDate;//下单时间

    private LocalDate requiredDate;//要求发货时间

    private String remark;//备注

    private Integer payedCount;//已付款的数量

    private String productName;//产品名称
    @TableLogic
    private Integer isDeleted;//逻辑删除
}
